<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import layoutVue from '@/layout/index.vue'

const isRouteReady = ref(false)
const router = useRouter()

onMounted(() => {
  // 监听路由是否准备就绪
  router.isReady().then(() => {
    isRouteReady.value = true;
    console.log("路由就绪了")
  })
})
</script>

<template>
  <div v-if="isRouteReady">
    <layoutVue />
  </div>
  <div v-else class="loading-container">
    <div class="loading">加载中...</div>
  </div>
</template>